package com.yyplatform.frontend.platform.account.controller;

import static com.yyplatform.frontend.Constants.URL_PREFIX;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yyplatform.frontend.platform.account.dto.LoginResultDTO;
import com.yyplatform.frontend.platform.account.dto.LoginWechatAppFormDTO;
import com.yyplatform.frontend.platform.account.service.WechatAppLoginService;
import com.yyplatform.frontend.infra.model.RestResponse;

import lombok.extern.slf4j.Slf4j;

/**
 * Created on 2024-10-18
 */
@CrossOrigin
@RequestMapping(URL_PREFIX + "/login/wechatApp/")
@RestController
@Slf4j
public class LoginWechatAppController {


    private WechatAppLoginService wechatAppLoginService;


    @PostMapping("loginCheck")
    public RestResponse<LoginResultDTO> loginCheck(LoginWechatAppFormDTO loginFormDTO) {
        LoginResultDTO loginResultDTO = wechatAppLoginService.loginCheck(loginFormDTO);
        return RestResponse.ok(loginResultDTO);
    }


}
